<?php !defined("IN_SYSTEM") && exit("ACCESS DENY");?>
<?php include template('header');?>
<div id="uc_ajax">
		<?php if($action == 'add' || $action == 'edit'):?>
	<form name="friend_add" method="post" action="<?=url('home.php?f=friend&a=save')?>" enctype="multipart/form-data">
			<input type="hidden" name="id" value="<?=$data['fid']?>" />
			<table cellspacing="0" class="uc_fa_table">
		<tr>
			<td colspan="2"><img src="<?php if($data['avatar']):?><?php echo $data['avatar'];?><?php else:?>static/images/avatar.jpg<?php endif;?>" style="width:60px;height:70px;float:left;margin-right:5px;"></img>
			<a href="javascript:;"><?php echo $lang['upload_new_avatar']?>:</a><br/>
			<input type="file" name="avatar" id="avatar" size="17"/><br/>
			<span class="uc_tips"><?php echo $lang['avatar_size_desc']?></span>
			</td>
			<td colspan="2">
			<table>
			<tr>
			<td class="td1" ><?php echo $lang['name'];?>：</td>
			<td><input type="text" name="name" class="input" size="22" value="<?php echo $data['name']?>" /></td>
			</tr><tr>
			<td class="td1" style="border:0 none;"><?php echo $lang['sex'];?>：</td>
			<td style="border:0 none;"><input type="radio" name="sex" <?php if($data['sex'] == 0):?>checked<?php endif;?> value="0" /><?php echo $sex['0'];?>  <input type="radio" name="sex" value="1" <?php if($data['sex'] == 1):?>checked<?php endif;?> /><?php echo $sex['1'];?> </td>
		
			</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['marry_status'];?>：</td>
			<td><select name="marry"><option value="0" <?php if($data['marry']==0):?>selected="selected"<?php endif;?> ><?php echo $lang['unmarried'];?></option><option value="1" <?php if($data['marry']==1):?>selected="selected"<?php endif;?> ><?php echo $lang['married'];?></option><option value="2" <?php if($data['marry']==2):?>selected="selected"<?php endif;?> ><?php echo $lang['divorced'];?></option></select></td>
			<td class="td2"><?php echo $lang['family'];?>：</td>
			<td><select name="gid"><?php foreach($group as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['gid']==$k):?>selected="selected"<?php endif;?> ><?php echo $v;?></option><?php endforeach;?></select></td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['blood_type'];?>：</td>
			<td><select name="blood"><?php foreach($blood as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['blood']==$k):?>selected="selected"<?php endif;?> ><?php echo $v;?></option><?php endforeach;?></select></td>
			<td class="td2"><?php echo $lang['edu'];?>：</td>
			<td><select name="edu"><?php foreach($edu as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['edu']==$k):?>selected="selected"<?php endif;?> ><?php echo $v;?></option><?php endforeach;?></select></td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['body_height'];?>：</td>
			<td><select name="height"><?php foreach($height as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['height']==$k):?>selected="selected"<?php endif;?> >{if $v<145}{echo $v.' '.$lang['undercm']}{elseif $v>195}{echo $v.' '.$lang['overcm']}{else}{echo $v.' '.$lang['centimeter']}{/if}</option><?php endforeach;?></select></td>
			<td class="td2"><?php echo $lang['body_weight'];?>：</td>
			<td><select name="weight"><?php foreach($weight as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['weight']==$k):?>selected="selected"<?php endif;?> >{if $v<40}{echo $v.' '.$lang['undercm']}{elseif $v>120}{echo $v.' '.$lang['overcm']}{else}{echo $v.' '.$lang['kilogram']}{/if}</option><?php endforeach;?></select></td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['monthly_income']?>：</td>
			<td><select name="wage"><?php foreach($wage as $k=>$v):?><option value="<?php echo $k;?>" <?php if($data['wage']==$k):?>selected="selected"<?php endif;?>><?php echo $v;?></option><?php endforeach;?></select></td>
			<td class="td2"><?php echo $lang['born'];?>：</td>
			<td colspan="3">
			<input name="birthday" id="birthday" class="input" size="22" value="{$data['born']}"  onclick="showcalendar(event);" />
			</td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['meet_time'];?>：</td>
			<td>
			<input name="addtime" id="addtime" class="input" size="22" value="{$data['addtime']}"  onclick="showcalendar(event);" />
			</td>
			<td class="td1"><?php echo $lang['last_meet_time'];?>：</td>
			<td >
			<input name="lasttime" class="input" size="22" id="lasttime" value="{$data['lasttime']}"  onclick="showcalendar(event);" />
			</td>
		
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['qq'];?>：</td>
			<td ><input type="text" name="qq" class="input" size="22" value="<?=$data['qq']?>" /></td>
			<td class="td2"><?php echo $lang['mail'];?>：</td>
			<td ><input type="text" name="mail" class="input" size="22" value="<?=$data['mail']?>" /></td>
		
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['phone'];?>：</td>
			<td ><input type="text" name="phone" class="input" size="22" value="<?=$data['phone']?>"/></td>
			<td class="td2"><?php echo $lang['tel'];?>：</td>
			<td ><input type="text" name="tel" class="input" size="22" value="<?=$data['tel']?>" /></td>
		
		</tr>
		
		<tr>
			<td class="td1"><?php echo $lang['addr'];?>：</td>
			<td colspan="3">
			<select name="prov1" id="prov1" onchange="getcity(this,'city1')"><option value="0"><?php echo $lang['province'];?></option><?php foreach ($prov as $k=>$v):?><option value="<?php echo $k;?>" <?php if($k == $data['prov1']):?>selected="selected"<?php endif;?>><?php echo $v;?></option><?php endforeach;?></select>
			<select name="city1" id="city1" onchange=""><option value="0"><?php echo $lang['city'];?></option><?php foreach ($city[$data['prov1']] as $k=>$v):?><option value="<?php echo $k;?>" <?php if($k == $data['city1']):?>selected="selected"<?php endif;?>><?php echo $v;?></option><?php endforeach;?></select>
			<input type="text" name="addr1" class="input" size="31" value="<?=$data['addr1']?>" /></td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['addr1'];?>：</td>
			<td colspan="3">
			<select name="prov2" id="prov2" onchange="getcity(this,'city2')"><option value="0"><?php echo $lang['province'];?></option><?php foreach ($prov as $k=>$v):?><option value="<?php echo $k;?>" <?php if($k == $data['prov2']):?>selected="selected"<?php endif;?>><?php echo $v;?></option><?php endforeach;?></select>
			<select name="city2" id="city2" onchange=""><option value="0"><?php echo $lang['city'];?></option><?php foreach ($city[$data['prov2']] as $k=>$v):?><option value="<?php echo $k;?>" <?php if($k == $data['city2']):?>selected="selected"<?php endif;?>><?php echo $v;?></option><?php endforeach;?></select>
			<input type="text" name="addr2" class="input" size="31" value="<?=$data['addr2']?>" /></td>
		</tr>
		
		
		<tr>
			<td class="td1"><?php echo $lang['hobby'];?>：</td>
			<td colspan="3"><input type="text" name="hobby" class="input" size="52" value="<?=$data['hobby']?>" /></td>
		</tr>
		<tr>
			<td class="td1"><?php echo $lang['extra'];?>：</td>
			<td colspan="3"><textarea  name="extra" cols="51" ><?php echo $data['extra'];?></textarea></td>
		</tr>
		<tr class="bg2"><td></td><td colspan="3"><input type="submit" class="button" value="<?php echo $lang['submit'];?>" /> </td></tr>
	</table>
	</form>
		
		<?php endif;?>
		<?php if($action == 'del'):?>
		<?php endif;?>

</div>

</body></html>